package com.zhyl.demo.service.impl;

import com.zhyl.demo.entity.HuaYan;
import com.zhyl.demo.mapper.HuaYanMapper;
import com.zhyl.demo.service.HuaYanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

@Service
public class HuaYanServiceImpl implements HuaYanService {
    private final HuaYanMapper huaYanMapper;
    @Autowired
    public HuaYanServiceImpl(HuaYanMapper huaYanMapper) {

        this.huaYanMapper = huaYanMapper;
    }

    @Override
    public Boolean addHuaYan(HuaYan huaYan) {
        Integer i = huaYanMapper.addHuaYan(huaYan);
        return i>=0;
    }

    @Override
    public ArrayList<HuaYan> getHuaYan(Integer appointmentId) {
        return huaYanMapper.getHuaYan(appointmentId);
    }

    @Override
    public Boolean updateHuaYan(HuaYan huaYan) {
        Integer i = huaYanMapper.updateHuaYan(huaYan);
        return i>=0;
    }

    @Override
    public ArrayList<HuaYan> getAllHuaYan() {
        return huaYanMapper.getAllHuaYan();
    }
}
